
#ifndef _REGISTERCLASS_
#define _REGISTERCLASS_

#include <winreg.h>		// for HKEY_CLASSES_ROOT

class CRegisterClass
{
public:
	CRegisterClass(REFCLSID clsid, LPCTSTR pszTypeName, HKEY hkeyRoot = HKEY_CLASSES_ROOT);
	
	void AddEntry(LPCTSTR key, LPCTSTR value, LPCTSTR valueName = NULL);
	int  AddSymbol(LPCTSTR symbol);
	int  AddSymbolAlias(LPCTSTR symbol, LPCTSTR alias);

	BOOL Register(BOOL bRegister = TRUE);
	BOOL SetRegKey(LPCTSTR lpszKey, LPCTSTR lpszValue, LPCTSTR lpszValueName = NULL);
	BOOL DelRegKey(LPCTSTR lpszKey, LPCTSTR lpszValueName = NULL);

	BOOL RemoveKey(LPCTSTR key);	// recursively remove key

protected:
	BOOL Helper(BOOL bUnregister, LPCTSTR const* ppSymbols, int nSymbols);

	HKEY m_hkeyRoot;
	CStringArray m_keys;
	CStringArray m_values;
	CStringArray m_valueNames;
	CStringArray m_symbols;
};

#endif
